<?php

/**
 * Gift form.
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class GiftForm extends BaseGiftForm
{
  public function configure()
  {

     $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'category_id' => new sfWidgetFormPropelChoice(array('model' => 'Giftcategory', 'add_empty' => false)),
      'photo_path' => new sfWidgetFormInputFile()
    ));  	
  	
        $this->validatorSchema ['photo_path'] = new sfValidatorFile ( array ('required' => true, 
		'path' => sfConfig::get ( 'sf_web_dir' ) . '/uploads/gift/item', 
		'mime_types' => 'web_images', 'max_size' => 500000,
        'validated_file_class' => 'sfGiftValidatedFile' ) );
    
    $this->widgetSchema->setNameFormat('gift[%s]');
  	$this->embedI18n(array('en', 'ru'));
  	
  }
}
